<% layout('../layouts/layout') %>
  <link rel="stylesheet" href="/css/zhgl.css">
  <link rel="stylesheet" href="\libs\bootstrapvalidator-master\dist\css\bootstrapValidator.min.css">
  <div class="">
    <%- partial('../includes/breadCrumbs.ejs', {
    breadCrumbs:[
      {
      'name':'账号管理', // 名称
      'url':'javascript://'        // url
      }
    ]
  }) %>
      <div class="qm-layout-content-wrapper">
        <div class="account">
          <div class="add-search clearfix">
            <button type="button" id="addAccountBtn" class="col-md-1 btn btn-info btn-xs add-account">新增账号</button>
            <div class="input-wrap col-md-4">
              <input id="searchInput" placeholder="输入账号信息进行搜索" type="text" class="form-control" name="title" avalon-events="input:_6,compositionstart:_4,compositionend:_5,focus:_2,blur:_3">
            </div>
            <span class="col-md-1 search-btn" id="searchBtn">
          <i style="color: #ff653b" class="fa fa-search"></i>
        </span>
          </div>

          <div>
            <table class="table">
              <thead>
                <tr>
                  <!--if-->
                  <!--ms-for:el in @columns-->
                  <th>操作</th>
                  <!--for856047115778-->
                  <th>账号</th>
                  <!--for856047115778-->
                  <th>客户名称</th>
                  <!--for856047115778-->
                  <th>业务系统</th>
                  <!--for856047115778-->
                  <th>开账日期</th>
                  <!--for856047115778-->
                  <th>联系人</th>
                  <!--for856047115778-->
                  <th>联系方式</th>
                  <!--for856047115778-->
                  <!--ms-for-end:-->
                </tr>
              </thead>
              <tbody id="tableBody">


              </tbody>
            </table>

            <!--分页-->
            <div class="page-center col-xs-12 text-center">
              <div id="pagination_page"></div>
            </div>
            <!--分页-->
            <div class="clearfix"></div>
          </div>
        </div>
        <!-- Modal -->
        <div class="modal fade" id="account" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
          <div class="modal-dialog" role="document">
            <div class="modal-content" id="accountFormWrap">
            </div>
          </div>
        </div>

      </div>
  </div>
  <script id="tableTpl" type="text/html">
    {{data}} {{ if vm.toggle === 3 }}
    <tr>
      <td colspan="7" style="text-align: center">暂无数据</td>
    </tr>
    {{ else }} {{each vm.infoList item i}}
    <tr>
      <td><i title="删除" data-handle="delete" class="operate-icon del fa fa-trash-o"></i><i title="修改" data-handle="update"  class="operate-icon edit fa fa-pencil-square-o"></i></td>
      <td>{{item.userName}}</td>
      <td>{{item.customer}}</td>
      <td>{{item.systemName}}</td>
      <td>{{item.establishTime}}</td>
      <td>{{item.contacts}}</td>
      <td>{{item.contactsPhone}}</td>
    </tr>
    {{/each}} {{ /if }}
  </script>
  <script id="accontFormTpl" type="text/html">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">{{ title }}</h4>
      </div>

      <div class="modal-body">
        <div class="bootbox-body">
            <form role="form" id="accountForm" class="">
              <div class="form-group has-feedback">
                <label class="control-label">账号：</label>
                <input style="margin-top: 5px;" type="test" required name="userName" value="{{form.userName}}" class="form-control" placeholder="" >
                <i class="form-control-feedback glyphicon-ok" style="display: none;"></i>
                <!--if-->
              </div>
              <div class="form-group has-feedback" >
                <label class="control-label">客户名称：</label>
                <input style="margin-top: 5px;" value="{{form.customer}}" type="text" class="form-control" name="customer" placeholder="">
                <i class="form-control-feedback glyphicon-ok" style="display: none;"></i>
                <!--if-->
              </div>
              <div class="form-group has-feedback" >
                <label class="control-label">联系人：</label>
                <input style="margin-top: 5px;" value="{{form.contacts}}" type="text" class="form-control" name="contacts" placeholder="" >
                <i class="form-control-feedback glyphicon-ok" style="display: none;"></i>
                <!--if-->
              </div>
              <div class="form-group has-feedback" >
                <label class="control-label">联系方式： </label>
                <input style="margin-top: 5px;" value="{{form.contactsPhone}}" type="text" class="form-control" name="contactsPhone" placeholder="">
                <i class="form-control-feedback glyphicon-ok" style="display: none;"></i>
                <!--if-->
              </div>
              <div class="form-group has-feedback" ><label class="control-label">业务系统： </label>
                <select style="margin-top: 5px;" class="form-control"  value="{{form.contactsPhone}}" name="bussinessSystem">
                  <option value="">请选择</option>
                  {{ each selectData item i }}
                    <option value="{{item.systemCode}}" {{item.systemCode === form.bussinessSystem ? 'selected' : ''}}>{{item.name}} --- {{item.remark}}</option>
                  {{/each}}
                  </select>
                <!--if-->
              </div>
              <input type="hidden" name="id"  value="{{form.id}}">
              <div class="modal-footer">
                <button data-bb-handler="save" id="submitBtn" type="submit" lay-filter="formAccount" class="btn btn-primary">提交</button>
                <button data-bb-handler="cancel" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
              </div>
            </form>
        </div>
      </div>
  </script>
  <% include ../layouts/layout.footer.ejs %>
  <script src="\libs\bootstrapvalidator-master\dist\js\bootstrapValidator.min.js"></script>
  <script src="\libs\bootstrapvalidator-master\dist\js\language\zh_CN.js"></script>
  <script src="/js/zhgl.js"></script>
